home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-websites-
/
sasg
/
dfa
/
rexx
/
filofaxtex.lzh
/
filofaxtex.dfa
Wrap
Text File
|
1995-12-16
|
5KB
|
232 lines
/* $Revision Header built automatically *************** (do not edit) ************
**
** © Copyright by Dirk Federlein
**
** File : Work:programming/dfa/rexx/FiloFaxTeX.dfa
** Created on : Dienstag, 25.10.94 21:40:03
** Created by : Dirk Federlein
** Current revision : V1.2
**
**
** Purpose
** -------
** Outputs a special tex formatted file which contains
** all selected addresses. The format fits the usual
** fileofax pages (size 96x172mm), but should be
** used together with dvidvi to make more than 1 page fit
** on one page.
**
** Revision V1.2
** --------------
** created on Dienstag, 25.10.94 22:54:53 by Dirk Federlein. LogMessage :
** - Now starts with a new 'page', if a "new" letter begins.
** For this a SORTED address file is needed!
**
** Revision V1.1
** --------------
** created on Dienstag, 25.10.94 22:53:49 by Dirk Federlein. LogMessage :
** - Now prints the generated file, so you don't have to
** print it manually:-)
**
** Print with:
**
** dvidvi -m 3:0,1(9.5cm,0in),2(19cm,0in) testfilofax.dvi out.dvi
** dvips -O0cm,-1cm -t landscape out.dvi
** (dviprint works as well, select "landscape ON")
**
** Revision V1.0
** --------------
** created on Dienstag, 25.10.94 21:40:03 by Dirk Federlein. LogMessage :
** --- Initial release ---
**
*********************************************************************************/
tabchar = '09'X
cr = '0A'X
TEXFILENAME = "ram:Filofax.tex"
DVIFILENAME = "ram:Filofax.dvi"
CONVERTFILENAME = "ram:CFilofax.dvi"
HEADERNAME = "TeX:templates/FiloFaxAdr.tex"
TeX = 'Tex:bin/virtex'
TeXFormat = '&glplain'
pagelines = 0
options results
address command "copy" HEADERNAME TEXFILENAME
address "DFA"
if open('exfh', TEXFILENAME ,'A') then
do
pageitems = 0
numchars=writech('exfh', '\addressheader' (cr))
/*
* Lock DFA gui
*/
gui input off output off
/*
* Get first address
*/
FIRST STEM ADR.
/*
* Keep track of 1st letter of surname
* for paging...
*/
CurrentLetter = left(ADR.ADDRESS.2,1)
LastLetter = left(ADR.ADDRESS.2,1)
/*
* Generate .tex file
*/
do while RC = 0
/*
* Begin a new page if the surname starts
* with a "new" letter
*/
if (pageitems > 0) & (CurrentLetter ~= LastLetter) then
do
numchars=writech('exfh', '\newpage' (cr))
numchars=writech('exfh', '\addressheader' (cr))
pageitems = 0
end
numchars=writech('exfh', '\addressbox{')
/*
* Used address fields are:
* - first name
* - surname
* - street
* - ZIP
* - City
* - Phone
* - Fax
* - Comment
*/
if ADR.ADDRESS.1 ~= "" then
numchars=writech('exfh', ADR.ADDRESS.1||'}{' )
else
numchars=writech('exfh', '\ }{')
if ADR.ADDRESS.2 ~= "" then
numchars=writech('exfh', ADR.ADDRESS.2||'}{')
else
numchars=writech('exfh', '\ }{')
if ADR.ADDRESS.4 ~= "" then
numchars=writech('exfh', ADR.ADDRESS.4||'}{')
else
numchars=writech('exfh', '\ }{')
if ADR.ADDRESS.5 ~= "" then
numchars=writech('exfh', ADR.ADDRESS.5||'}{')
else
numchars=writech('exfh', '\ }{')
if ADR.ADDRESS.6 ~= "" then
numchars=writech('exfh', ADR.ADDRESS.6||'}{')
else
numchars=writech('exfh', '\ }{')
if ADR.ADDRESS.10 ~= "" then
numchars=writech('exfh', ADR.ADDRESS.10||'}{')
else
numchars=writech('exfh', '---}{')
if ADR.ADDRESS.11 ~= "" THEN
numchars=writech('exfh', ADR.ADDRESS.11||'}{')
else
numchars=writech('exfh', '\ }{')
/*
* The comment may be up to 50 characters long
*/
if ADR.ADDRESS.15 ~= "" THEN
numchars=writech('exfh', left(ADR.ADDRESS.15,50)||'}'||(cr))
else
numchars=writech('exfh', '\ }' (cr) )
/*
* Up to 6 address items fit on one page
*/
pageitems = pageitems + 1
if pageitems = 6 then
do
numchars=writech('exfh', '\newpage' (cr))
numchars=writech('exfh', '\addressheader' (cr))
pageitems = 0
end
next stem adr.
/*
* Get 1st letter of the surname
*/
LastLetter = CurrentLetter
CurrentLetter = left(ADR.ADDRESS.2,1)
end
/*
* End of document
*/
numchars=writech('exfh', '\end{document}' (cr))
/*
* Reactivate DFA gui
*/
gui input on output on
/*
* Process generated file
*/
address command TeX TeXFormat TEXFILENAME
/*
* Put 3 small pages on one A4 page (landscape needed)
*/
address command "dvidvi -m 3:0,1(9.5cm,0in),2(19cm,0in) " DVIFILENAME CONVERTFILENAME
/*
* Output landscape pages
*/
address command "dvips -O0cm,-1cm -t landscape " CONVERTFILENAME
end
exit